<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title> Frame to test replaceChild "action" </title>
<script type='text/javascript'>
window.addEventListener("message", function(e) {
  if (e.data != "Success!")
    top.postMessage("Fail!", "*");
  else
    top.postMessage(e.data, "*");
},false);

(function() {
  var html =
    "<!DOCTYPE html>\n" +
    "<html>\n" +
    "<body>\n" +
    "<form action=\"/misc/resources/form-post-success.html\" method=\"post\">\n" +
    "<input type=\"submit\" value=\"Send\" />\n" +
    "</form>\n" +
    "</body>\n" +
    "</html>";
  document.addEventListener("DOMContentLoaded", function() {
    var parsed_document = (new DOMParser).parseFromString(html, 'text/html');
    document.documentElement.replaceChild(parsed_document.body, document.body);
  });
}).call(this);
</script>
</head>
</html>
